#region Using directives
using System;
using System.Collections.Generic;
using System.Text;
using webapp4U.DAL;
#endregion


namespace webapp4U.BOL
{
	 public class Orders
	 {
	     #region Member Variables

	     private Int32 _orderID;

	     private DateTime _addedDate;

	     private String _addedBy;

	     private Int32 _statusID;

	     private String _shippingMethod;

	     private Decimal _subTotal;

	     private Decimal _shipping;

	     private String _taxCode;

	     private String _shippingName;

	     private String _shippingAddress;

	     private String _shippingPostalCode;

	     private String _shippingCity;

	     private String _shippingState;

	     private String _shippingCountry;

	     private String _customerEmail;

	     private String _customerPhone;

	     private String _customerFax;

	     private DateTime _shippedDate;

	     private String _transactionID;

	     private String _trackingID;

	     #endregion


	     #region Public Properties

	     public Int32 OrderID
	     {
		     get { return _orderID; }
		     set { _orderID = value; }
	     }

	     public DateTime AddedDate
	     {
		     get { return _addedDate; }
		     set { _addedDate = value; }
	     }

	     public String AddedBy
	     {
		     get { return _addedBy; }
		     set { _addedBy = value; }
	     }

	     public Int32 StatusID
	     {
		     get { return _statusID; }
		     set { _statusID = value; }
	     }

	     public String ShippingMethod
	     {
		     get { return _shippingMethod; }
		     set { _shippingMethod = value; }
	     }

	     public Decimal SubTotal
	     {
		     get { return _subTotal; }
		     set { _subTotal = value; }
	     }

	     public Decimal Shipping
	     {
		     get { return _shipping; }
		     set { _shipping = value; }
	     }

	     public String TaxCode
	     {
		     get { return _taxCode; }
		     set { _taxCode = value; }
	     }

	     public String ShippingName
	     {
		     get { return _shippingName; }
		     set { _shippingName = value; }
	     }

	     public String ShippingAddress
	     {
		     get { return _shippingAddress; }
		     set { _shippingAddress = value; }
	     }

	     public String ShippingPostalCode
	     {
		     get { return _shippingPostalCode; }
		     set { _shippingPostalCode = value; }
	     }

	     public String ShippingCity
	     {
		     get { return _shippingCity; }
		     set { _shippingCity = value; }
	     }

	     public String ShippingState
	     {
		     get { return _shippingState; }
		     set { _shippingState = value; }
	     }

	     public String ShippingCountry
	     {
		     get { return _shippingCountry; }
		     set { _shippingCountry = value; }
	     }

	     public String CustomerEmail
	     {
		     get { return _customerEmail; }
		     set { _customerEmail = value; }
	     }

	     public String CustomerPhone
	     {
		     get { return _customerPhone; }
		     set { _customerPhone = value; }
	     }

	     public String CustomerFax
	     {
		     get { return _customerFax; }
		     set { _customerFax = value; }
	     }

	     public DateTime ShippedDate
	     {
		     get { return _shippedDate; }
		     set { _shippedDate = value; }
	     }

	     public String TransactionID
	     {
		     get { return _transactionID; }
		     set { _transactionID = value; }
	     }

	     public String TrackingID
	     {
		     get { return _trackingID; }
		     set { _trackingID = value; }
	     }

	     #endregion

	     #region public static Methods

         public static List<Orders> Search(string Keyword, int StatusID, string FromDate, string ToDate)
         {
             OrdersDAL db = new OrdersDAL();
             return db.Search(Keyword.Trim(),StatusID,FromDate.Trim(),ToDate.Trim());
         }


         public static bool UpdateStatus(int OrderID, int StatusID)
         {
             OrdersDAL db = new OrdersDAL();
             return db.UpdateStatus(OrderID, StatusID);
         }

	     public static int Insert(Orders obj)
	     {
		     OrdersDAL db = new OrdersDAL();
		     return db.Insert(obj);
	     }

	     public static bool Update(Orders obj)
	     {
		     OrdersDAL db = new OrdersDAL();
		     return db.Update(obj);
	     }

	     public static bool Delete(Int32 OrderID)
	     {
		     OrdersDAL db = new OrdersDAL();
		     return db.Delete(OrderID); 
	     }

	     public static Orders GetOrdersByID(Int32 OrderID)
	     {
		     OrdersDAL db = new OrdersDAL();
		     return db.GetOrdersByID(OrderID);
	     }

         //Get All Orders
         public static List<Orders> GetAllOrders()
         {
             OrdersDAL db = new OrdersDAL();
             return db.GetAllOrders(1, 1000);
         }

	     //Get All Orders
	     public static List<Orders> GetAllOrders(int PageIndex, int PageSize)
	     {
		     OrdersDAL db = new OrdersDAL();
		     return db.GetAllOrders(PageIndex, PageSize);
	     }

	     // Get Count All records of Table  Orders
	     public static int GetCountOrders()
	     {
		     OrdersDAL db = new OrdersDAL();
		     return db.GetCountOrders();
	     }



	     #endregion
	 }
}
